function sol = NNsysExact_ing0_p(t, params)
% params is array of pairs (string name, double value)
  
    R0init = params('R0init');    
    cellinit = params('cellinit');
    k2 = params('k2');
    k_ads_fast = params('k_ads_fast');
    k_complex = params('k_complex');
    k_deads = params('k_deads');
    k_rna_ads = params('k_rna_ads');
    k_rna_deads = params('k_rna_deads');
    kc = params('kc');
    kcf_in_coef = params('kcf_in_coef');
    k_diff = params('kdiff');
    kout = params('kout');
    kpolypi_obr = params('kpolypi_obr');
    kv = params('kv');    
    me = params('me');
    mlipid_slow = params('mlipid_slow');
    mpolyp = params('mpolyp');
    mpolypi = params('mpolypi');
    vesNS4B = params('vesNS4B');
    k_ads = params('k_ads');
    mcf = params('mcf');
    mr_coef = params('mr_coef');
    k_ads_slow = 0;
    
    %ode15s - something, fast - with ing - many comp problems
    %ode23s - almost all zeros
    %ode23t - something, many errors of computation
    %ode23tb - 
    %ode113 - slow, comp problems
    
    ic = [R0init 0 0 0 0 0 0 cellinit 0 0 0 0 0 0];
    optsBeforeSplit = odeset('AbsTol',1e-5,'InitialStep',1e-10,'MaxStep',1);
    optsAfterSplit = odeset('AbsTol',1e-10,'InitialStep',1e-6);
    
    splitTime = 100;
    stepAfterSplit = 300;
    stepBeforeSplit = 10;
    times = [0:stepBeforeSplit:splitTime (splitTime+stepAfterSplit):stepAfterSplit:t];
    sol = [];
    
    for i=1:(length(times)-1)
        if(times(i) < splitTime)            
            sol = ode15s(@NNsys2solver, [times(i) times(i+1)], ic, optsBeforeSplit);
        else
            sol = ode15s(@NNsys2solver, [times(i) times(i+1)], ic, optsAfterSplit);
        end
        ic = deval(sol, times(i+1));
    end

    %sol = ode15s(@NNsys2solver, [0 t], ic, opts);

    
    function dydt = NNsys2solver(tt,kmrgd)
        interferoncf = 1;
        interferonmr = 1;
        
        kcf_in = kcf_in_coef*mcf*interferoncf;
        mr = mr_coef * interferonmr;        

        dydt=[ kout * kmrgd(10) - k_rna_ads * kmrgd(7) * kmrgd(1) + k_rna_deads * kmrgd(9) - mr * kmrgd(1);
         k2 * kmrgd(1) + kpolypi_obr * kmrgd(3) - kc * kmrgd(2) - mpolyp * kmrgd(2);
         - kpolypi_obr * kmrgd(3) - mpolypi * kmrgd(3);
         kc * kmrgd(2) - vesNS4B * k_complex * kmrgd(5) * kmrgd(4) - me * kmrgd(4);
         kc * kmrgd(2) - vesNS4B * k_complex * kmrgd(5) * kmrgd(4) - me * kmrgd(5);
         k_complex * kmrgd(5) * kmrgd(4) - (k_ads_fast + k_ads_slow ) * kmrgd(6) - k_ads * kmrgd(6) * kmrgd(8) - me * kmrgd(6);
         k_ads * kmrgd(6) * kmrgd(8) - kv * kmrgd(7) + k_deads * kmrgd(8) * (kmrgd(12) + kmrgd(13)) - k_rna_ads * kmrgd(7) * kmrgd(1) + k_rna_deads * kmrgd(9) - me * kmrgd(7);
         kcf_in - k_ads * kmrgd(6) * kmrgd(8) - k_deads * kmrgd(8) * (kmrgd(12) + kmrgd(13)) - mcf * kmrgd(8);
         k_rna_ads * kmrgd(7) * kmrgd(1) - k_rna_deads * kmrgd(9) - kv * kmrgd(9) - me * kmrgd(9);
         kv * kmrgd(9) - me * kmrgd(10);
         kv * kmrgd(7) - me * kmrgd(11);
         k_diff * ( -kmrgd(12) +  kmrgd(13)) + k_ads_fast * kmrgd(6) - k_deads * kmrgd(8) * kmrgd(12) - me * kmrgd(12);
         k_diff * ( kmrgd(12) - kmrgd(13)) - k_deads * kmrgd(8) * kmrgd(13) - mlipid_slow * kmrgd(13);
         0];
    end
end